package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// OrderGrabsEntityToDto entity data transfer
func OrderGrabsEntityToDto(orderGrabs []*entity.OrderGrab) []*model.OrderGrabInfo {
	out := make([]*model.OrderGrabInfo, 0, len(orderGrabs))
	for _, c := range orderGrabs {
		out = append(out, OrderGrabEntityToDto(c))
	}
	return out
}

// OrderGrabEntityToDto entity data transfer
func OrderGrabEntityToDto(e *entity.OrderGrab) *model.OrderGrabInfo {
	return &model.OrderGrabInfo{

		Id: e.Id,

		OrderId: e.OrderId,

		UserId: e.UserId,

		GrabTime: e.GrabTime,

		Status: e.Status,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
